<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:aop="http://www.springframework.org/schema/aop"
    xmlns="http://www.springframework.org/schema/beans"
    xsi:schemaLocation="http://www.springframework.org/schema/beans 
                           http://www.springframework.org/schema/beans/spring-beans.xsd
                           http://www.springframework.org/schema/context 
                           http://www.springframework.org/schema/context/spring-context.xsd
                           http://www.springframework.org/schema/aop
                           http://www.springframework.org/schema/aop/spring-aop-3.0.xsd" >

    <!-- ******************* -->
    <!-- Hibernate -->
    <!-- ******************* -->

    <bean
        id="hibernateSessionFactory"
        class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean" >

        <property
            name="dataSource"
            ref="dataSource" />

        <property name="annotatedClasses" >

            <list>

                <value>
model.Person
                </value>

                <value>
model.Angebotstyp
                </value>

                <value>
model.TypStatus
                </value>

                <value>
model.Anfrage
                </value>
            </list>
        </property>

        <property name="hibernateProperties" >

            <props>

                <prop key="hibernate.dialect" >
org.hibernate.dialect.MySQLDialect
                </prop>

                <prop key="hibernate.hbm2ddl.auto" >
update
                </prop>

                <prop key="hibernate.show_sql" >
true
                </prop>

                <prop key="hibernate.cache.provider_class" >
org.hibernate.cache.NoCacheProvider
                </prop>

                <prop key="hibernate.connection.release_mode" >
after_statement
                </prop>
                <!-- https://forum.hibernate.org/viewtopic.php?t=969312 -->
            </props>
        </property>
    </bean>

    <bean
        id="transactionManager"
        class="org.springframework.orm.hibernate3.HibernateTransactionManager" >

        <property
            name="sessionFactory"
            ref="hibernateSessionFactory" />
    </bean>

    <!-- ******************* -->
    <!-- Data Access Objects -->
    <!-- ******************* -->

    <bean
        id="typStatusDao"
        class="dao.TypStatusDao" >

        <property
            name="sessionFactory"
            ref="hibernateSessionFactory" />
    </bean>

    <bean
        id="personDao"
        class="dao.PersonDao" >

        <property
            name="sessionFactory"
            ref="hibernateSessionFactory" />
    </bean>

    <bean
        id="angebotstypDao"
        class="dao.AngebotstypDao" >

        <property
            name="sessionFactory"
            ref="hibernateSessionFactory" />
    </bean>

    <bean
        id="anfrageDao"
        class="dao.AnfrageDao" >

        <property
            name="sessionFactory"
            ref="hibernateSessionFactory" />
    </bean>

    <bean
        id="loginCredentials"
        class="model.LoginCredentials"
        scope="session" >

        <aop:scoped-proxy />
    </bean>

</beans>